package com.wmyg.antifake.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wmyg.antifake.bean.Bill;
import com.wmyg.antifake.dao.BillMapper;
import com.wmyg.antifake.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BillServiceImpl implements BillService {

    @Autowired
    BillMapper  BillDao;

    @Override
    public int selectCountBill() {
        return BillDao.selectCountBill();
    }

    @Override
    public PageInfo<Bill> selectBillList(Bill bill) {
        PageHelper.startPage(bill.getPageIndex(), bill.getPageSize(), " bill_id desc");
        List<Bill> billList = BillDao.selectBillList(bill);
        PageInfo result = new PageInfo(billList);
        return result;
    }

}
